/**
 * @file antd的引入
 * @author its-wild(https://gitee.com/its-wild)
 * @date 2022/07/27
 */
import { App } from 'vue'
import {
  ConfigProvider,
  Layout,
  Menu,
  Tabs,
  message,
  Modal,
  Button,
  Checkbox,
  Input,
  Form,
  Divider,
  Row,
  Col,
  Select,
  Card,
  Table,
  Popconfirm,
  Breadcrumb
} from 'ant-design-vue'

const installComponents = [
  ConfigProvider,
  Layout,
  Menu,
  Tabs,
  Button,
  Modal,
  Checkbox,
  Input,
  Form,
  Divider,
  Row,
  Col,
  Select,
  Card,
  Table,
  Popconfirm,
  Breadcrumb
]

class Antd {
  /**
   * Called automatically by `app.use(Antd)`. Should not be called manually by
   * the user.
   * @param app - Application that uses the Antd
   */
  static install(app: App): void {
    installComponents.forEach(component => {
      app.use(component)
    })
    app.config.globalProperties.$message = message
    app.config.globalProperties.$modal = Modal
  }
}

export default Antd
